home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text.html.parser;
-
- import java.io.Serializable;
- import java.util.BitSet;
- import java.util.Hashtable;
-
- public final class Element implements DTDConstants, Serializable {
- public int index;
- public String name;
- public boolean oStart;
- public boolean oEnd;
- public BitSet inclusions;
- public BitSet exclusions;
- public int type = 19;
- public ContentModel content;
- public AttributeList atts;
- static int maxIndex = 0;
- public Object data;
- static Hashtable contentTypes = new Hashtable();
-
- static {
- contentTypes.put("CDATA", new Integer(1));
- contentTypes.put("RCDATA", new Integer(16));
- contentTypes.put("EMPTY", new Integer(17));
- contentTypes.put("ANY", new Integer(19));
- }
-
- Element() {
- }
-
- Element(String var1, int var2) {
- this.name = var1;
- this.index = var2;
- maxIndex = Math.max(maxIndex, var2);
- }
-
- public AttributeList getAttribute(String var1) {
- for(AttributeList var2 = this.atts; var2 != null; var2 = var2.next) {
- if (var2.name.equals(var1)) {
- return var2;
- }
- }
-
- return null;
- }
-
- public AttributeList getAttributeByValue(String var1) {
- for(AttributeList var2 = this.atts; var2 != null; var2 = var2.next) {
- if (var2.values != null && var2.values.contains(var1)) {
- return var2;
- }
- }
-
- return null;
- }
-
- public AttributeList getAttributes() {
- return this.atts;
- }
-
- public ContentModel getContent() {
- return this.content;
- }
-
- public int getIndex() {
- return this.index;
- }
-
- public String getName() {
- return this.name;
- }
-
- public int getType() {
- return this.type;
- }
-
- public boolean isEmpty() {
- return this.type == 17;
- }
-
- public static int name2type(String var0) {
- Integer var1 = (Integer)contentTypes.get(var0);
- return var1 != null ? var1 : 0;
- }
-
- public boolean omitEnd() {
- return this.oEnd;
- }
-
- public boolean omitStart() {
- return this.oStart;
- }
-
- public String toString() {
- return this.name;
- }
- }
-